package cc.vv.btpartyjob.jnimodule.server

import cc.vv.baselibrary.http.BaseHttpRequest
import cc.vv.btpartyjob.jnimodule.api.JniModuleAPI
import cc.vv.btpartyjob.jnimodule.moudel.bean.JniDataBean
import cc.vv.btpartyjob.jnimodule.moudel.req.BannerRequestObj
import cc.vv.btpartyjob.jnimodule.moudel.req.NewsRequestObj
import cc.vv.btpartyjob.jnimodule.moudel.req.OrgDetailRequestObj
import cc.vv.btpartyjob.jnimodule.moudel.resp.BannerResponseObj
import cc.vv.btpartyjob.jnimodule.moudel.resp.NewsResponseObj
import cc.vv.btpartyjob.jnimodule.moudel.resp.OrgDetailResponseObj

/**
 * 假数据Server
 * Created by Chen.qi on 2018/10/24.
 */
object JniDataServer {

    fun getCommunityData(): ArrayList<JniDataBean> {
        val head = "http://pfldczj5q.bkt.clouddn.com/d4faeb807fa448da9b450518754865da20181024181945tiny-79-2018-10-24-18-19-45.jpg"
        val optionList = ArrayList<JniDataBean>()
        val obj1 = JniDataBean(head, "宝塔区人社局机关党支部书记谈体会的感受", "描述1", "2018-10-20", false)
        val obj2 = JniDataBean(head, "啊发顺丰撒发顺丰", "阿达", "2018-10-20", true)
        val obj3 = JniDataBean(head, "法法法法 ", "啊发发", "2018-10-20", true)
        val obj4 = JniDataBean(head, "啊发顺丰撒飞洒发", " 发发骚", "2018-10-20", false)
        val obj5 = JniDataBean(head, "的方法是否", " 法法", "2018-10-20")
        val obj6 = JniDataBean(head, "答复按时发生", " 发送", "2018-10-20")
        val obj7 = JniDataBean(head, "法法萨芬", "啊发送方", "2018-10-20")
        val obj8 = JniDataBean(head, "一法法萨芬单元", "法法", "2018-10-20")
        val obj9 = JniDataBean(head, " 法法萨芬三", "法法", "2018-10-20")
        val obj10 = JniDataBean(head, "一  法法萨芬", "法师法师", "2018-10-20")
        val obj11 = JniDataBean(head, " 法法", "啊安抚", "2018-10-20")
        val obj12 = JniDataBean(head, "一单元", "描述1", "2018-10-20")
        val obj13 = JniDataBean(head, " 爱发谁发安抚 安抚啊发送啊", "描述1", "2018-10-20")
        val obj14 = JniDataBean(head, "啊发发安抚", " 啊", "2018-10-20")
        val obj15 = JniDataBean(head, " 啊", "安抚AA", "2018-10-20")
        optionList.add(obj1)
        optionList.add(obj2)
        optionList.add(obj3)
        optionList.add(obj4)
        optionList.add(obj5)
        optionList.add(obj6)
        optionList.add(obj7)
        optionList.add(obj8)
        optionList.add(obj9)
        optionList.add(obj10)
        optionList.add(obj11)
        optionList.add(obj12)
        optionList.add(obj13)
        optionList.add(obj14)
        optionList.add(obj15)
        return optionList
    }

    fun getYearData(): List<String> {
        val listYear = ArrayList<String>()
        listYear.add("2020年")
        listYear.add("2019年")
        listYear.add("2018年")
        listYear.add("2017年")
        listYear.add("2016年")
        listYear.add("2015年")
//        listYear.add("2014年")
//        listYear.add("2013年")
//        listYear.add("2012年")
//        listYear.add("2011年")
//        listYear.add("2010年")
//        listYear.add("2009年")
//        listYear.add("2008年")
//        listYear.add("2007年")
//        listYear.add("2006年")
//        listYear.add("2005年")
//        listYear.add("2004年")
//        listYear.add("2003年")
//        listYear.add("2002年")
//        listYear.add("2001年")
//        listYear.add("2000年")

        return listYear
    }

    /**
     * 可见范围
     */
    fun getShowFanWeiData(): List<String> {
        val listYear = ArrayList<String>()
        listYear.add("本网格可见")
        listYear.add("本单位可见")
        listYear.add("本社区可见")
        listYear.add("本街道可见")
        listYear.add("宝塔区可见")
        return listYear
    }




    /** 获取新闻头条列表*/
    fun getNewsList(jiedaoId: String?, shequId: String?, wangGeId: String?, page: Int, pageSize: Int, type: String, isShow: Boolean = false) {
        val request = NewsRequestObj()
        request.street = jiedaoId
        request.community = shequId
        request.grid = wangGeId
        request.page = "$page"
        request.pageSize = "$pageSize"
        request.type = type
        BaseHttpRequest.getRequest(JniModuleAPI.newsHeadList, request, NewsResponseObj::class.java, isShow)
    }


    /** 获取示范典型列表*/
    fun getDemonstrationList(page: Int, pageSize: Int, type: String, isShow: Boolean = false) {
        val request = NewsRequestObj()
        request.page = "$page"
        request.pageSize = "$pageSize"
        request.type = type
        val path = JniModuleAPI.demonstrationList + "/" + "$page" + "/" + "$pageSize" + "?type" + type
        BaseHttpRequest.postRequest(path, request, NewsResponseObj::class.java, isShow)
    }

    /**
     * 获取banner
     */
    fun getBannerList(category: String, pageSize: Int = 5, isShow: Boolean = false) {
        val banReq = BannerRequestObj()
        banReq.category = category
        banReq.page = "1"
        banReq.pageSize = "20"
        BaseHttpRequest.getRequest(JniModuleAPI.bannerList, banReq, BannerResponseObj::class.java, isShow)
    }

    /**
     * 获取组织机构详情
     */
    fun getOrganDetail(orgId: String?, isShow: Boolean = false) {
        val banReq = OrgDetailRequestObj()
        banReq.orgId = orgId
        BaseHttpRequest.getRequest(JniModuleAPI.orgDetail, banReq, OrgDetailResponseObj::class.java, isShow)
    }

}